
<?php

$feedURL = 'http://www.runnersworld.com/cda/videorss.xml/1,7881,,00.xml';
$rss = file_get_contents($feedURL);
$xml = new SimpleXMLElement($rss);

echo "<h1>".$xml->channel[0]->title."</h1>\n";
echo "<p> VIDEOS DE RUNNING EN EL MUNDO <br/> \n";
echo printf('Link <a href="%s">%s</a><br />' . "\n",  $xml->channel[0]->link, $xml->channel[0]->link);
echo "</p>\n";
echo "<p> Ultima Actualizacion: ".$xml->channel[0]->lastBuildDate."</p>\n";

foreach($xml->channel[0]->item as $item)
{
    echo "<p>\n";
    // para cada tag dentro de item
    foreach($item->children() as $nodo)
    {
        switch($nodo->getName())
        {           
         case 'title':
             echo "<b>$nodo</b><br/>\n";
             break;
         
         case 'link':
             echo "<a href='$nodo'>$nodo</a><br/>\n";
             break;
         
         case 'description':
             echo "<p>$nodo</p><br/>\n";
             break;
        }
    }
    
    echo"</p>\n";
}
    

?>

